
// Array Fixes
//-- fix array that doesn't support indexOf
if (!Array.prototype.indexOf){

   Array.prototype.indexOf = function(o, from){

      var my = this,

         l = my.length;

      from = Dx.isNumber(from) ?

            from

            :

            0;

      from = (from < 0) ?

         Math.ceil(from)

         :

         Math.floor(from);

      if (from < 0){

         from += l;

      }

      for (; from < l; from++) {

         if ( (from in my) && (my[from] === o) ){

            return from;

         }
      }

      return -1;

   }
}

if (!Array.prototype.lastIndexOf){

   Array.prototype.lastIndexOf = function(o, from){

      var my = this,

         l = my.length;

      if (Dx.isNumber(from)){

         from = (from < 0) ?

            Math.ceil(from)

            :

            Math.floor(from);

         if (from < 0) {

            from += l;

         } else if (from >= l){

            from = l - 1;

         }
      } else {

         from = l - 1;

      }


      for (; from > -1; from--) {

         if ((from in my) && (my[from] === o)){

            return from;

         }

      }

      return -1;
   };


}

// Production steps of ECMA-262, Edition 5, 15.4.4.18
if (!Array.prototype.forEach){

   Array.prototype.forEach = function(fn, scope){

      var T,

         o = Object(this);

      if (!Dx.isFunction(fn)) {

         throw new TypeError();

      }

      if ( scope ) {

         T = scope;

      }

      for(var c=0, l = o.length >>> 0, name; c < l; c++) {

         if (c in o){

            fn.call( T, o[c], c, o );

         }

      }

   };

}
